/*
Copyright (c) [2019年5月1日] [吴超]
[MBT_studio] is licensed under Mulan PSL v2.
You can use this software according to the terms and conditions of the Mulan PSL v2.
You may obtain a copy of Mulan PSL v2 at:
		 http://license.coscl.org.cn/MulanPSL2
THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
See the Mulan PSL v2 for more details.
*/
#pragma once

#include "../节点.h"
#include "字符串转换.h"
//#include "../C_插座数据类型.h"



class C_动态转换插座 : public C_插座基类 {
public:
	C_动态转换插座(std::string name);
	~C_动态转换插座();

	//S_插座数据	m_Value;

	void		f_setData(void* data, int64 ID=-1);
	PyObject* f_bl_传入数据(PyObject* bl_data);
	PyObject* f_输出_bl数据(PyObject* bl_data = 0);
	
	void	f_转换(E_值类型 类型);
};

#define DEF_动态转换插座(socket) dynamic_cast<C_动态转换插座*>( (socket) )
//#define DEF_动态转换插座Value(socket)  *((float32*)(DEF_动态转换插座( (socket) )->f_getData()) )
#define DEF_动态转换插座Value(socket)  *((float32*)(DEF_动态转换插座( (socket) )->f_Data()) )

#define DEF_创建动态转换插座_I(name)  socket = new C_动态转换插座( (name) ); f_add插座(socket, E_插座输出方向::e_插座Type_输入);
#define DEF_创建动态转换插座_O(name)  socket = new C_动态转换插座( (name) ); f_add插座(socket, E_插座输出方向::e_插座Type_输出);








class C_Socket_Any转PyObject : public C_插座基类 {
public:
	C_Socket_Any转PyObject(std::string name);
	~C_Socket_Any转PyObject();

	void* f_getData();
	void		f_setData(void* data, int64 ID = -1);
	PyObject* f_输出_bl数据(PyObject* bl_data = 0);
};







